Preformatted text between the start and end PRE tag is rendered using a fixed with font, in addition whitespace characters are treated literally. The spacing and line breaks are rendered directly, unlike other elements, for which repeated whitespace chararacters are collapsed to a single space character and line breaks introduced automatically.
Line breaks within the text are rendered as a move to the beginning of the next line. The exceptions are line breaks immediately following the starting PRE tag or immediately preceding the ending PRE tag, which should be ignored.
The <P> tag should be avoided, but for robustness, user agents are recommended to treat these tags as line breaks.
Anchor elements, and character highlighting elements may be used.
FORM elements may be included, and the fixed width font exploited to control layout (the TAB or TABLE elements give similar control for normal text though).
Block-like elements such as headers, lists, FIG and TABLES should be avoided.
The horizontal tab character (encoded in US ASCII and ISO 8859-1 as decimal 9) should be interpreted as the smallest nonzero number of spaces which will leave the number of characters so far on the line as a multiple of 8. Its use is deprecated!
ID
An SGML identifier used as the target for hypertext links or for naming particular elements in
associated style sheets. Identifiers are NAME tokens and must be unique within the scope of the current
document.
LANG
This is one of the ISO standard language abbreviations, e.g. "en.uk" for the variety of
English spoken in the United Kingdom. It can be used by parsers to select language specific choices for
quotation marks, ligatures and hyphenation rules. The language attribute is composed from the two letter
language code from ISO 639, optionally followed by a period and a two letter country code from ISO
3166.
CLASS
This a space separated list of SGML NAME tokens and is used to subclass tag names. By
convention, class names are interpreted hierarchically, with the most general class on the left and the most
specific on the right, where classes are separated by a period. The CLASS attribute is most commonly used
to attach a different style to some element, but it is recommended that where practical class names should be
picked on the basis of the element's semantics, because this permitsother uses, such as restricting search
through documents by matching on element class names. The conventions for choosing class names are
outside the scope of this document.
CLEAR
This attribute is common to all block-like elements. When text flows around a figure or table in the
margin, you sometimes want to start the preformatted text below the figure rather than alongside it. The
CLEAR attribute allows you to move down unconditionally:
WIDTH
This is optionally used to specify a width as a number of characters to try and display within the
current window width. The user agent can exploit this suggestion to select an appropriate font size. The
default is a width of 80 characters. Where the WIDTH attribute is supported, widths of 40, 80 and 132
characters should be presented optimally, with other widths being rounded up.
<PRE> is legal within:
<BANNER>, <BODYTEXT>, <DD>, <DIV>, <FIGTEXT>,
<FN>, <FORM>, <LI>, <NOTE>, <TD>, <TH>
The following markup can be used within <PRE>
<A>, <ABBREV>, <ACRONYM>, <AU>, <B>, <BIG>,
<BR>, <CITE>, <CODE>, <DEL>, <DFN>, <EM>, <I>,
<IMG>, <INS>, <KBD>, <LANG>, <MATH>, <PERSON>, <Q>,
<S>, <SAMP>, <SMALL>, <STRONG>, <SUB>, <SUP>,
<TAB>, <TT>, <U>, <VAR>
<PRE>names age Bobby 6 Jenny 7 Eddie 5 </PRE>